[#637] Align trade price calculation between real-time and cron indexers#654
Merged
realproject7 merged 1 commit intomainfrom Mar 30, 2026
Merged
[#637] Align trade price calculation between real-time and cron indexers#654realproject7 merged 1 commit intomainfrom
realproject7 merged 1 commit intomainfrom
Conversation
Real-time indexer used priceForNextMint (marginal bonding curve price) while cron indexer used batch average (reserveAmount / tokenAmount). Switched real-time to batch average to match cron: - Reflects actual cost paid, not marginal price - Removes extra priceForNextMint RPC call - Deterministic and consistent regardless of which path runs first Fixes #637 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
approved these changes
Mar 30, 2026
Collaborator
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The realtime trade indexer now uses the same batch-average price_per_token calculation as the cron trade-history route, so the two paths will stop producing divergent values for the same trade. The change is minimal and stays within the scope of the ticket.
Findings
- No blocking findings.
Decision
Approving because the updated realtime calculation matches the cron path and resolves the consistency issue described in Queue #637 / agent-os#317.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/index/trade): ReplacedpriceForNextMint(marginal bonding curve price) with batch average (reserveAmount / tokenAmount) to match the cron indexer.priceForNextMintFunctionimport and extra RPC call.price_per_tokenvalues for the same trade.Fixes #637
Tracks realproject7/agent-os#317
Test plan
price_per_tokenis consistent regardless of which indexer runspriceForNextMintRPC call in real-time path🤖 Generated with Claude Code